﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XMLib;

namespace ActionSystem.Core
{
    /// <summary>
    /// 整个系统的配置，可序列化，编辑器可以导入或者设置配置
    /// 定义所有的常量
    /// </summary>
    [System.Serializable]
    public class ActionSystemConfig
    {
        #region 编辑器配置数据
        [Range(1, 145)]
        [CustomLabel("帧率")]
        [SerializeField]
        public int _frameRate = 60;

        //需要初始化的对象池子,需要具备PoolInitAttribute和继承IPoolItem
        [Drawable(false)]
        public List<Type> poolItemTypes = new List<Type>();
        #endregion



        private float _frameTime = 0;
        /// <summary>
        /// 每一帧的时间,与编辑器绑定(默认60帧)
        /// </summary>
        public float FrameTime { get => _frameTime; }
        /// <summary>
        /// 帧率
        /// </summary>
        public int FrameRate { get => _frameRate; }
        /// <summary>
        /// 初始化一些配置数据
        /// </summary>
        public void InitInternalData()
        {
            _frameTime = 1.0f / _frameRate;
        }
    }
    
}
